package STUDENT.TRANNGUYENQUAN.OOPs.OBJECT_AND_CLASSES.OddEven;

public class Models {
	public boolean isEven(MyInteger num) {
		if (num.getValue() % 2 == 0) {
			return true;
		} else {
			return false;
		}
	}

	public boolean isOdd(MyInteger num) {
		if (num.getValue() % 2 != 0) {
			return true;
		} else {
			return false;
		}
	}

	public boolean isPrime(MyInteger num) {
		int dem = 0;
		for (int i = 1; i <= num.getValue(); i++) {
			if (num.getValue() % i == 0) {
				dem++;
			}
		}
		if (dem == 2) {
			return true;
		} else {
			return false;
		}
	}

	public static boolean IsEven(MyInteger num) {
		if (num.getValue() % 2 == 0) {
			return true;
		} else {
			return false;
		}
	}

	public static boolean IsOdd(MyInteger num) {
		if (num.getValue() % 2 != 0) {
			return true;
		} else {
			return false;
		}
	}

	public static boolean IsPrime(MyInteger num) {
		int dem = 0;
		for (int i = 2; i <= num.getValue(); i++) {
			if (num.getValue() % i == 0) {
				dem++;
			}
		}
		if (dem == 2) {
			return true;
		} else {
			return false;
		}
	}
}
